package patterns.structures.composite.program;

import java.util.ArrayList;

public class ConcreteMovie extends Movie {

	ConcreteMovie(String name){
		this.name=name;
		list=new ArrayList<Movie>();
	}
	
	@Override
	public void add(Movie movie) {
		list.add(movie);
	}

	@Override
	public void remove(Movie movie) {
		if(list.contains(movie)){
			list.remove(movie);
		}
	}

	@Override
	public void display() {
		System.out.println(this.name);
		for(Movie movie:list){
			movie.display();
		}
	}

}
